import 'package:word_game/engine/hero.dart';
import 'package:word_game/task/kill_monster_task.dart';

import 'task_expecta.dart';

class KillMonsterTaskExpecta extends TaskExpecta {
  @override
  bool expecta(Hero hero, dynamic task) {
    var taskObj = task as KillMonsterTask;
    for (var info in taskObj.monsterInfo) {
      int number = 0;
      if (info['number'] != null) {
        number = int.parse(info['number']);
      }
      int killedNumber = 0;
      if (info['killedNumber'] != null) {
        killedNumber = int.parse(info['killedNumber']);
      }
      if (killedNumber<number) {
        return false;
      }
    }
    return true;
  }

}